using Admin2025.Domain.Common;

namespace Admin2025.Domain.Repositories;

/// <summary>
/// 通用仓储接口
/// </summary>
/// <typeparam name="T">
public interface IRepository<T>
{
    Task<IEnumerable<T>> GetAllAsync();

    Task<PagedResult<T>> GetPagedAsync(int pageIndex, int pageSize);

    Task<T?> GetByIdAsync(Guid id);

    Task<T> CreateAsync(T entity);
    Task UpdateAsync(T entity);

    // 软删除
    Task DeleteAsync(T entity);

    // 软删除
    Task DeleteAsync(Guid id);

    // 硬删除
    Task DeleteHardAsync(Guid id);
    
}